//      desktop.h
//      
//      Copyright 2011 DJ Shaji <djshaji@gmail.com>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.


#ifndef DESKTOP_H
#define DESKTOP_H

#include <april/april.h>
#include <gdk/gdkx.h>

typedef struct _Desktop {
	GtkWindow * window ;
	GtkImage * wallpaper ;
	GtkLayout * lt ;
	GtkTreeStore * store ;
	gboolean icons_visible ;
	gint icons_x, icons_y ;
	GFileMonitor * file_monitor ;
	GFile * desktop ;
} Desktop ;

typedef struct _DesktopIcon {
	GtkEventBox * e ;
	GtkImage * image ;
	GtkLabel * label ;
	
	gchar * path ;
	GtkTreeStore * store ;
	Desktop * desktop ;
	GtkTreeIter * iter ;
	gint x, y ;
} DesktopIcon ;

void desktop_init ( void ) ;
gboolean desktop_show_menu ( GtkWidget * widget, GdkEventButton * event, Desktop * d ) ;

GtkMenu * desktop_create_menu ( Desktop * d ) ;
void desktop_load_icons ( Desktop * d ) ;

gchar * _desktop_icon_name_mod ( gchar * name ) ;
gboolean desktop_icon_activated ( GtkWidget * widget, GdkEventButton * event, DesktopIcon * icon ) ;
DesktopIcon * desktop_icon_new ( Desktop * d ) ;
void desktop_icon_destroy ( DesktopIcon * icon ) ;
GtkMenu * desktop_create_menu_file ( DesktopIcon * icon ) ;
void desktop_icon_delete ( DesktopIcon * icon ) ;
void desktop_open ( gchar * filename ) ;

vodi desktop_icon_rename ( DesktopIcon * icon ) ;
vodi desktop_icon_properties ( DesktopIcon * icon ) ;
void desktop_open_with ( DesktopIcon * icon ) ;
void desktop_refresh ( vodi ) ;
vodi desktop_toggle_icons ( GtkWidget * widget, Desktop * desktop ) ;
void desktop_changed ( GFileMonitor * fm, GFile * f1, GFile * f2, GFileMonitorEvent event, Desktop * d ) ;
#endif
